﻿/*------------------------------------------------
// File Description: LineMaterialBill DataBase Entity
// Author:			 Crane
// Create Time:		 2022-03-23 12:27:59
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 
    /// </summary>
    [Table(nameof(LineMaterialBill))]
    public class LineMaterialBill : BaseEntity
    {
        private string _billNo = string.Empty;
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;
        private string _orderNo = string.Empty;
        private string _workOrderNo = string.Empty;
        private string _lineName = string.Empty;
        private string _batchNoBig = string.Empty;
        private string _batchNoSmall = string.Empty;

        #region Public Property

        ///<Summary>
        /// 单据类型
        ///</Summary>
        public Enum.LineMaterialBillType BillType { get; set; }

        ///<Summary>
        /// 单号
        ///</Summary>
        public string BillNo
        {
            get { return string.IsNullOrWhiteSpace(_billNo) ? string.Empty : _billNo; }
            set { _billNo = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 产线ID
        ///</Summary>
        public int LineId { get; set; }

        ///<Summary>
        /// 产线名称
        ///</Summary>
        public string LineName
        {
            get { return string.IsNullOrWhiteSpace(_lineName) ? string.Empty : _lineName; }
            set { _lineName = value; }
        }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 
        /// </summary>
        public virtual DbSet<LineMaterialBill> LineMaterialBills { get; set; }
    }
}